package com.macro.mall.config;

import com.macro.mall.util.RequestDataMethodArgumentResolver;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author HuangZiy
 * @version 8.0
 * @date 2021/5/12 12:11
 */
@Configuration
public class AutoConfig {

    @Configuration
    @ConditionalOnWebApplication
    protected static class ApiMvcConfiguration implements WebMvcConfigurer {

        @Override
        public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
            argumentResolvers.add(new RequestDataMethodArgumentResolver());
        }
    }

}
